package com.kingdee.eas.scm.sm.pur.app;

import javax.ejb.*;
import java.rmi.RemoteException;
import com.kingdee.bos.*;
import com.kingdee.bos.util.BOSObjectType;
import com.kingdee.bos.metadata.IMetaDataPK;
import com.kingdee.bos.metadata.rule.RuleExecutor;
import com.kingdee.bos.metadata.MetaDataPK;
//import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.framework.ejb.AbstractEntityControllerBean;
import com.kingdee.bos.framework.ejb.AbstractBizControllerBean;
//import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.IObjectCollection;
import com.kingdee.bos.service.ServiceContext;
import com.kingdee.bos.service.IServiceContext;
import com.kingdee.eas.framework.Result;
import com.kingdee.eas.framework.LineResult;
import com.kingdee.eas.framework.exception.EASMultiException;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;

import java.lang.String;
import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.eas.scm.sm.pur.PurRequestEntryInfo;
import com.kingdee.eas.framework.CoreBillEntryBaseCollection;
import com.kingdee.eas.scm.sm.pur.PurRequestEntryCollection;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.eas.framework.CoreBaseCollection;
import com.kingdee.eas.scm.common.SCMBillEntryBaseCollection;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.eas.framework.CoreBaseInfo;
import com.kingdee.eas.scm.common.app.SCMBillEntryBaseControllerBean;



public abstract class AbstractPurRequestEntryControllerBean extends SCMBillEntryBaseControllerBean implements PurRequestEntryController
{
    protected AbstractPurRequestEntryControllerBean()
    {
    }

    protected BOSObjectType getBOSType()
    {
        return new BOSObjectType("2B7DD5E4");
    }

    public PurRequestEntryInfo getPurRequestEntryInfo(Context ctx, IObjectPK pk) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("3c010ddf-0105-1000-e000-0117c0a812fb"), new Object[]{ctx, pk});
            invokeServiceBefore(svcCtx);
            PurRequestEntryInfo retValue = (PurRequestEntryInfo)_getValue(ctx, pk);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectValue _getValue(Context ctx, IObjectPK pk) throws BOSException, EASBizException
    {
        return super._getValue(ctx, pk);
    }

    public PurRequestEntryInfo getPurRequestEntryInfo(Context ctx, IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("3c010ddf-0105-1000-e000-0118c0a812fb"), new Object[]{ctx, pk, selector});
            invokeServiceBefore(svcCtx);
            PurRequestEntryInfo retValue = (PurRequestEntryInfo)_getValue(ctx, pk, selector);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectValue _getValue(Context ctx, IObjectPK pk, SelectorItemCollection selector) throws BOSException, EASBizException
    {
        return super._getValue(ctx, pk, selector);
    }

    public PurRequestEntryInfo getPurRequestEntryInfo(Context ctx, String oql) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("3c010ddf-0105-1000-e000-0119c0a812fb"), new Object[]{ctx, oql});
            invokeServiceBefore(svcCtx);
            PurRequestEntryInfo retValue = (PurRequestEntryInfo)_getValue(ctx, oql);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectValue _getValue(Context ctx, String oql) throws BOSException, EASBizException
    {
        return super._getValue(ctx, oql);
    }

    public PurRequestEntryCollection getPurRequestEntryCollection(Context ctx) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("3c010ddf-0105-1000-e000-011ac0a812fb"), new Object[]{ctx});
            invokeServiceBefore(svcCtx);
            PurRequestEntryCollection retValue = (PurRequestEntryCollection)_getCollection(ctx, svcCtx);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx) throws BOSException
    {
        return super._getCollection(ctx, svcCtx);
    }

    public PurRequestEntryCollection getPurRequestEntryCollection(Context ctx, EntityViewInfo view) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("3c010ddf-0105-1000-e000-011bc0a812fb"), new Object[]{ctx, view});
            invokeServiceBefore(svcCtx);
            PurRequestEntryCollection retValue = (PurRequestEntryCollection)_getCollection(ctx, svcCtx, view);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx, EntityViewInfo view) throws BOSException
    {
        return super._getCollection(ctx, svcCtx, view);
    }

    public PurRequestEntryCollection getPurRequestEntryCollection(Context ctx, String oql) throws BOSException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("3c010ddf-0105-1000-e000-011cc0a812fb"), new Object[]{ctx, oql});
            invokeServiceBefore(svcCtx);
            PurRequestEntryCollection retValue = (PurRequestEntryCollection)_getCollection(ctx, svcCtx, oql);
            svcCtx.setMethodReturnValue(retValue);
            invokeServiceAfter(svcCtx);
            return retValue;
        } catch (BOSException ex) {
            throw ex;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected IObjectCollection _getCollection(Context ctx, IServiceContext svcCtx, String oql) throws BOSException
    {
        return super._getCollection(ctx, svcCtx, oql);
    }

    public void closeEntry(Context ctx, IObjectPK pk, String reasonCode) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("98c688c2-0105-1000-e000-0064c0a81225"), new Object[]{ctx, pk, reasonCode});
            invokeServiceBefore(svcCtx);
            _closeEntry(ctx, pk, reasonCode);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _closeEntry(Context ctx, IObjectPK pk, String reasonCode) throws BOSException, EASBizException;

    public void closeEntry(Context ctx, IObjectPK[] ids) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("98c688c2-0105-1000-e000-0069c0a81225"), new Object[]{ctx, ids});
            invokeServiceBefore(svcCtx);
            _closeEntry(ctx, ids);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _closeEntry(Context ctx, IObjectPK[] ids) throws BOSException, EASBizException;

    public void closeEntry(Context ctx, IObjectPK[] pks, IObjectValue[] vos) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("a39a122a-0105-1000-e000-0004c0a81225"), new Object[]{ctx, pks, vos});
            invokeServiceBefore(svcCtx);
            _closeEntry(ctx, pks, vos);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _closeEntry(Context ctx, IObjectPK[] pks, IObjectValue[] vos) throws BOSException, EASBizException;

    public void closeEntry(Context ctx, IObjectPK[] pk, String[] vos) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("3b3e5fa1-010e-1000-e000-007cc0a812d9"), new Object[]{ctx, pk, vos});
            invokeServiceBefore(svcCtx);
            _closeEntry(ctx, pk, vos);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _closeEntry(Context ctx, IObjectPK[] pk, String[] vos) throws BOSException, EASBizException;

    public void submitToWf(Context ctx, IObjectValue model) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("1baa7224-0115-1000-e000-0024c0a8129f"), new Object[]{ctx, model});
            invokeServiceBefore(svcCtx);
            _submitToWf(ctx, model);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _submitToWf(Context ctx, IObjectValue model) throws BOSException, EASBizException;

    public void auditForWf(Context ctx, IObjectPK pk, IObjectPK parentpk) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("1baa7224-0115-1000-e000-0025c0a8129f"), new Object[]{ctx, pk, parentpk});
            invokeServiceBefore(svcCtx);
            _auditForWf(ctx, pk, parentpk);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            throw ex;
        } catch (EASBizException ex0) {
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _auditForWf(Context ctx, IObjectPK pk, IObjectPK parentpk) throws BOSException, EASBizException;

    public void unClose(Context ctx, IObjectPK pk) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("debec923-0118-1000-e000-018ac0a812e0"), new Object[]{ctx, pk});
            invokeServiceBefore(svcCtx);
            _unClose(ctx, pk);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _unClose(Context ctx, IObjectPK pk) throws BOSException, EASBizException;

    public void unClose(Context ctx, IObjectPK[] pks) throws BOSException, EASBizException
    {
        try {
            ServiceContext svcCtx = createServiceContext(new MetaDataPK("debec923-0118-1000-e000-018cc0a812e0"), new Object[]{ctx, pks});
            invokeServiceBefore(svcCtx);
            _unClose(ctx, pks);
            invokeServiceAfter(svcCtx);
        } catch (BOSException ex) {
            this.setRollbackOnly();
            throw ex;
        } catch (EASBizException ex0) {
            this.setRollbackOnly();
            throw ex0;
        } finally {
            super.cleanUpServiceState();
        }
    }
    protected abstract void _unClose(Context ctx, IObjectPK[] pks) throws BOSException, EASBizException;

    public SCMBillEntryBaseCollection getSCMBillEntryBaseCollection (Context ctx) throws BOSException
    {
    	return (SCMBillEntryBaseCollection)(getPurRequestEntryCollection(ctx).cast(SCMBillEntryBaseCollection.class));
    }
    public SCMBillEntryBaseCollection getSCMBillEntryBaseCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (SCMBillEntryBaseCollection)(getPurRequestEntryCollection(ctx, view).cast(SCMBillEntryBaseCollection.class));
    }
    public SCMBillEntryBaseCollection getSCMBillEntryBaseCollection (Context ctx, String oql) throws BOSException
    {
    	return (SCMBillEntryBaseCollection)(getPurRequestEntryCollection(ctx, oql).cast(SCMBillEntryBaseCollection.class));
    }
    public CoreBillEntryBaseCollection getCoreBillEntryBaseCollection (Context ctx) throws BOSException
    {
    	return (CoreBillEntryBaseCollection)(getPurRequestEntryCollection(ctx).cast(CoreBillEntryBaseCollection.class));
    }
    public CoreBillEntryBaseCollection getCoreBillEntryBaseCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (CoreBillEntryBaseCollection)(getPurRequestEntryCollection(ctx, view).cast(CoreBillEntryBaseCollection.class));
    }
    public CoreBillEntryBaseCollection getCoreBillEntryBaseCollection (Context ctx, String oql) throws BOSException
    {
    	return (CoreBillEntryBaseCollection)(getPurRequestEntryCollection(ctx, oql).cast(CoreBillEntryBaseCollection.class));
    }
    public CoreBaseCollection getCoreBaseCollection (Context ctx) throws BOSException
    {
    	return (CoreBaseCollection)(getPurRequestEntryCollection(ctx).cast(CoreBaseCollection.class));
    }
    public CoreBaseCollection getCoreBaseCollection (Context ctx, EntityViewInfo view) throws BOSException
    {
    	return (CoreBaseCollection)(getPurRequestEntryCollection(ctx, view).cast(CoreBaseCollection.class));
    }
    public CoreBaseCollection getCoreBaseCollection (Context ctx, String oql) throws BOSException
    {
    	return (CoreBaseCollection)(getPurRequestEntryCollection(ctx, oql).cast(CoreBaseCollection.class));
    }
}